// Initialize butotn with users's prefered color
document.getElementById("import").addEventListener("click", async () => {
  let [tab] = await chrome.tabs.query({ active: true, currentWindow: true });
  chrome.scripting.executeScript({
    target: { tabId: tab.id },
    files :['content.js'],
  });
});
document.getElementById("export").addEventListener("click", async () => {
  let [tab] = await chrome.tabs.query({ active: true, currentWindow: true });
  chrome.scripting.executeScript({
    target: { tabId: tab.id },
    files :['content2.js'],
  });
});
chrome.runtime.onMessage.addListener(
  function(request, sender, sendResponse) {
    if (request == "import"){
      sendResponse({text:document.getElementById("text").value,farewell: "goodbye"});
    }else{
      sendResponse({text:request,farewell: "goodbye"});
    }
  }
);